package lms.service.impl;

import lms.dao.OperationDao;
import lms.dao.impl.BookDaoImpl;
import lms.dao.impl.ReaderDaoImpl;
import lms.service.OperationService;

import java.util.List;

/**
 * @description:
 * @author: Grape_Pip
 * @time: 2021/06/22
 */
public class ReaderServiceImpl<Reader> implements OperationService<Reader> {

    private OperationDao readerDaoImpl = new ReaderDaoImpl();

    @Override
    public List<Reader> selectedAllInfo() {
        return readerDaoImpl.selectAllInfo();
    }

    @Override
    public boolean deletedById(int vid) {
        int res = readerDaoImpl.deleteById(vid);
        if (res == 1) {
            return true;
        } else {
            return false;
        }
    }

    @Override
    public boolean updatedById(int vid, Reader object) {
        int res = readerDaoImpl.updateById(vid, object);
        if (res == 1) {
            return true;
        } else {
            return false;
        }
    }

    @Override
    public boolean insertedInfo(Reader object) {
        int res = readerDaoImpl.insertInfo(object);
        if (res == 1) {
            return true;
        } else {
            return false;
        }
    }

    @Override
    public Reader selectedById(int vid) {
        return (Reader) readerDaoImpl.selectById(vid);
    }

    @Override
    public boolean updateStocksById(int bid, int bNum) {
        return false;
    }


}
